package com.uoko.plugins.redis.aspect;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * Redis切面处理类
 *
 * @author shaohua
 * Email shaohua@uoko.com
 * created by 2018/6/1
 */
@Aspect
@Component
public class RedisAspect {
    @Value("${spring.redis.aspectOpen:true}")
    private boolean aspectOpen;

    @Around("execution(* com.uoko.plugins.redis.common.*.*(..)))")
    public Object around(ProceedingJoinPoint point) throws Throwable {
        Object result = null;
        if (aspectOpen) {
            result = point.proceed();
        }
        return result;
    }
}
